package cn.javass.dp.decorator.example4;

import java.util.Date;

/**
 * 装饰器接口，需要跟被状好似的对象实现同样的接口
 */
public abstract class Decorator extends Component {

    protected Component c;

    //如果抽象类 有默认意外的构造，子类必须重写构造
    public Decorator(Component c) {
        this.c = c;
    }

    @Override
    public double calcPrize(String user, Date begin, Date end) {
        //转调组件使用方法
        return c.calcPrize(user, begin, end);
    }
}
